package com.bailian.system.domain.vo;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.bailian.common.annotation.Excel;
import com.bailian.common.core.domain.BaseEntity;
import com.bailian.system.domain.BlAppointment;
import com.bailian.system.domain.BlWarehouse;
import com.bailian.system.domain.BlPhoneUser;
import com.bailian.system.domain.vo.BlParkVo;

/**
 * 仓库预约列表视图对象 bl_appointment
 * 
 * @author bailian
 * @date 2025-08-04
 */
public class BlAppointmentVo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long appointmentId;

    /** 仓库ID */
    @Excel(name = "仓库ID")
    private Long warehouseId;

    /** 预约日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预约日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date visitDate;

    /** 预约时间 */
    @Excel(name = "预约时间")
    private String visitTime;

    /** 参观人数 */
    @Excel(name = "参观人数")
    private String visitorCount;

    /** 联系人姓名 */
    @Excel(name = "联系人姓名")
    private String contactName;

    /** 联系电话 */
    @Excel(name = "联系电话")
    private String contactPhone;

    /** 电子邮箱 */
    @Excel(name = "电子邮箱")
    private String email;

    /** 备注信息 */
    @Excel(name = "备注信息")
    private String remarks;

    /** 预约状态（0，待确认，1已确认，2取消） */
    @Excel(name = "预约状态", readConverterExp = "0=待确认,1=已确认,2=取消")
    private Integer status;

    /** 审批时间 */
    private Date approveTime;

    /** 审批人ID */
    @Excel(name = "审批人ID")
    private Long approveId;

    /** 申请人ID */
    @Excel(name = "申请人ID")
    private Long userId;

    /** 所属公司 */
    @Excel(name = "所属公司")
    private String belongCompany;

    /** 驳回原因 */
    @Excel(name = "驳回原因")
    private String rejectionReasons;

    // ========== 关联查询字段 ==========
    
    /** 关联的仓库信息 */
    private BlWarehouse warehouse;
    
    /** 关联的用户信息 */
    private BlPhoneUser user;
    
    /** 关联的园区信息 */
    private BlParkVo park;

    // ========== 构造函数 ==========
    
    public BlAppointmentVo() {}
    
    public BlAppointmentVo(BlAppointment appointment) {
        if (appointment != null) {
            this.appointmentId = appointment.getAppointmentId();
            this.warehouseId = appointment.getWarehouseId();
            this.visitDate = appointment.getVisitDate();
            this.visitTime = appointment.getVisitTime();
            this.visitorCount = appointment.getVisitorCount();
            this.contactName = appointment.getContactName();
            this.contactPhone = appointment.getContactPhone();
            this.email = appointment.getEmail();
            this.remarks = appointment.getRemarks();
            this.status = appointment.getStatus();
            this.approveTime = appointment.getApproveTime();
            this.approveId = appointment.getApproveId();
            this.userId = appointment.getUserId();
            this.belongCompany = appointment.getBelongCompany();
            this.rejectionReasons = appointment.getRejectionReasons();
            // 使用setter方法设置BaseEntity的字段
            this.setCreateTime(appointment.getCreateTime());
            this.setUpdateTime(appointment.getUpdateTime());
        }
    }

    // ========== Getter和Setter方法 ==========
    
    public Long getAppointmentId() 
    {
        return appointmentId;
    }

    public void setAppointmentId(Long appointmentId) 
    {
        this.appointmentId = appointmentId;
    }

    public Long getWarehouseId() 
    {
        return warehouseId;
    }

    public void setWarehouseId(Long warehouseId) 
    {
        this.warehouseId = warehouseId;
    }

    public Date getVisitDate() 
    {
        return visitDate;
    }

    public void setVisitDate(Date visitDate) 
    {
        this.visitDate = visitDate;
    }

    public String getVisitTime() 
    {
        return visitTime;
    }

    public void setVisitTime(String visitTime)
    {
        this.visitTime = visitTime;
    }

    public String getVisitorCount() 
    {
        return visitorCount;
    }

    public void setVisitorCount(String visitorCount) 
    {
        this.visitorCount = visitorCount;
    }

    public String getContactName() 
    {
        return contactName;
    }

    public void setContactName(String contactName) 
    {
        this.contactName = contactName;
    }

    public String getContactPhone() 
    {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) 
    {
        this.contactPhone = contactPhone;
    }

    public String getEmail() 
    {
        return email;
    }

    public void setEmail(String email) 
    {
        this.email = email;
    }

    public String getRemarks() 
    {
        return remarks;
    }

    public void setRemarks(String remarks) 
    {
        this.remarks = remarks;
    }

    public Integer getStatus() 
    {
        return status;
    }

    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Date getApproveTime() 
    {
        return approveTime;
    }

    public void setApproveTime(Date approveTime) 
    {
        this.approveTime = approveTime;
    }

    public Long getApproveId() 
    {
        return approveId;
    }

    public void setApproveId(Long approveId) 
    {
        this.approveId = approveId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public String getBelongCompany() 
    {
        return belongCompany;
    }

    public void setBelongCompany(String belongCompany) 
    {
        this.belongCompany = belongCompany;
    }

    public String getRejectionReasons() 
    {
        return rejectionReasons;
    }

    public void setRejectionReasons(String rejectionReasons) 
    {
        this.rejectionReasons = rejectionReasons;
    }

    public BlWarehouse getWarehouse() 
    {
        return warehouse;
    }

    public void setWarehouse(BlWarehouse warehouse) 
    {
        this.warehouse = warehouse;
    }

    public BlPhoneUser getUser() 
    {
        return user;
    }

    public void setUser(BlPhoneUser user) 
    {
        this.user = user;
    }

    public BlParkVo getPark() 
    {
        return park;
    }

    public void setPark(BlParkVo park) 
    {
        this.park = park;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("appointmentId", getAppointmentId())
            .append("warehouseId", getWarehouseId())
            .append("visitDate", getVisitDate())
            .append("visitTime", getVisitTime())
            .append("visitorCount", getVisitorCount())
            .append("contactName", getContactName())
            .append("contactPhone", getContactPhone())
            .append("email", getEmail())
            .append("remarks", getRemarks())
            .append("status", getStatus())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("approveTime", getApproveTime())
            .append("approveId", getApproveId())
            .append("userId", getUserId())
            .append("belongCompany", getBelongCompany())
            .append("rejectionReasons", getRejectionReasons())
            .append("warehouse", getWarehouse())
            .append("user", getUser())
            .append("park", getPark())
            .toString();
    }
}
